import type { PageType } from "@/api/type";
import request from "@/util/request";
import type { FroSchool } from "./type";

enum API {
    FRO_SCHOOL_PAGE_URL = "/front/school/page",
    FRO_SCHOOL_CREATE_URL = "/fornt/school/create",
    FRO_SCHOOL_MODIFY_URL = "/fornt/school/modify",
}
export function reqGetSchoolList(query: object) {
    return request<PageType<FroSchool>>({
        url: API.FRO_SCHOOL_PAGE_URL,
        method: 'get',
        params: query
    })
}

export function reqAddSchool(data: FroSchool) {
    return request<PageType<FroSchool>>({
        url: API.FRO_SCHOOL_CREATE_URL,
        method: 'post',
        data
    })
}

export function reqModifySchool(data: FroSchool) {
    return request<PageType<FroSchool>>({
        url: API.FRO_SCHOOL_MODIFY_URL,
        method: 'put',
        data
    })
}